import {Entity,Column,PrimaryGeneratedColumn,JoinColumn,OneToOne} from 'typeorm'
import Guest from './guest'
import Article from './article'

@Entity('g_comment')
export default class comment{

    @PrimaryGeneratedColumn()
    id:number

    @Column('datetime')
    gmt_created:string

    @Column('datetime')
    gmt_updated:string

    @Column()    //默认长度255
    content:string

    @Column('tinyint')
    deleted:boolean

    @OneToOne(type => Guest)
    @JoinColumn()
    author_id:number

    @OneToOne(type => Article)
    @JoinColumn()
    article_id:number
    
    @OneToOne(type => comment)
    @JoinColumn()
    parent_id:number
}